public class TranslatePolygon implements Action{
  Polygon p;
  float initX,initY;
  public TranslatePolygon(Polygon p){
    this.p = p;
  }
  
 public void mouseDrag(float x, float y) {
    this.p.translate((int)(x-initX),(int)(y-initY));
    initX = x;
    initY = y;
  }

  public void mouseClick(float x, float y) {
    this.initX = x;
    this.initY = y;
  }

  void mousePress(float x, float y) {
    this.initX = x;
    this.initY = y;
  }
  void mouseMove(float x, float y) {
  }
}
